package com.ternnetwork.batch.reader;

import javax.annotation.Resource;

import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.file.FlatFileItemReader;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.ternnetwork.batch.item.file.ExtendedMultiResourceItemReader;
import com.ternnetwork.batch.model.TestUser;


/**
 * 
 * @author xuwenfeng
 *
 */
@Configuration
public class TestUserMultiResourceItemReaderConfinguration {
	
	@Resource
	private FlatFileItemReader<TestUser> testUserFlatFileItemReader;
	
	@Bean("testUserMultiResourceItemReader")
	public ItemReader<TestUser> getItemReader(){
		
		 ExtendedMultiResourceItemReader<TestUser>  itemReader=new  ExtendedMultiResourceItemReader<TestUser>();
	
		 itemReader.setResourcesLocationPattern("test-data/*.txt");
		 
		 itemReader.setDelegate(testUserFlatFileItemReader);
		 
		 return itemReader;
	
	}
	

}
